class Music:
    def __init__(self, number, title, album, artist, composer, lyricist, file_path):
        self.number = number
        self.title = title
        self.album = album
        self.artist = artist
        self.composer = composer
        self.lyricist = lyricist
        self.file_path = file_path

class MusicManager:
    def __init__(self):
        self.music_dict = {}

    def add_music(self, music):
        self.music_dict[music.number] = music

    def remove_music(self, number):
        if number in self.music_dict:
            del self.music_dict[number]

    def search_music_by_title(self, title):
        result = []
        for music in self.music_dict.values():
            if music.title.lower() == title.lower():
                result.append(music)
        return result

    def search_music_by_artist(self, artist):
        result = []
        for music in self.music_dict.values():
            if music.artist.lower() == artist.lower():
                result.append(music)
        return result


# 创建音乐管理器实例
music_manager = MusicManager()

# 添加音乐
music1 = Music(1, "Song 1", "Album A", "Artist X", "Composer X", "Lyricist X", "/path/to/file1.mp3")
music2 = Music(2, "Song 2", "Album B", "Artist Y", "Composer Y", "Lyricist Y", "/path/to/file2.mp3")
music3 = Music(3, "Song 3", "Album A", "Artist X", "Composer X", "Lyricist X", "/path/to/file3.mp3")
music4 = Music(4, "Song 4", "Album A", "Artist X", "Composer X", "Lyricist X", "/path/to/file3.mp3")

music_manager.add_music(music1)
music_manager.add_music(music2)
music_manager.add_music(music3)
music_manager.add_music(music4)


# 根据歌名查找
search_result = music_manager.search_music_by_title("Song 1")
for music in search_result:
    print("Found music: " + music.title)

# 根据歌手查找
search_result = music_manager.search_music_by_artist("Artist X")
for music in search_result:
    print("Found music: " + music.title)

# 删除音乐
music_manager.remove_music(2)
